package artibella.ui.combos 
{
	import flash.display.CapsStyle;
	import flash.display.JointStyle;
	import flash.display.LineScaleMode;
	import flash.display.Sprite;
	
	/**
	 * ...
	 * @author ...
	 */
	public class ComboButton extends Sprite implements IStateSetable
	{
		
		public function ComboButton() 
		{
			_init();
		}
		
		private function _init():void
		{
			//buttonMode = true;
			
			draw();
		}
		
		// - - -
		
		public function draw():void
		{
			setState( false );
		}
		
		public function setState( opened:Boolean ):void
		{
			graphics.clear();
			
			graphics.beginFill( 0xffffff, 0 );
			//graphics.lineStyle( 1 , 0x000000, 1, false, LineScaleMode.NONE, CapsStyle.SQUARE, JointStyle.MITER, 3  );
			graphics.drawRect( 0, 0, 20, 20 );
			graphics.lineStyle( 1 , 0x000000, .5, false, LineScaleMode.NONE, CapsStyle.SQUARE, JointStyle.MITER, 3  );
			graphics.lineTo( 0, 20 );
			
			if ( !opened ) {
				graphics.beginFill( 0x666666 );
				graphics.moveTo( 6, 8 );
				graphics.lineTo( 14, 8 );
				graphics.lineTo( 10, 12 );
				graphics.lineTo( 6, 8 );
				graphics.endFill();
			} else {
				graphics.beginFill( 0x666666 );
				graphics.moveTo( 6, 11 );
				graphics.lineTo( 14, 11 );
				graphics.lineTo( 10, 7 );
				graphics.lineTo( 6, 11 );
				graphics.endFill();
			}
			
		}

	}

}